/**
 * 
 */
package monster.comm.log;

import org.apache.commons.logging.Log;

/**
 * log4j处理类，主要为log4j加了日志写入前判断
 * @author wanghong
 * 2012-12-26
 * MonLog.java
 * 
 */
public class MonLog implements ILog{
    private Log log;
    public  MonLog(Log log){
    	this.log = log;
    }
	@Override
	public void debug(String e) {
		if(log.isDebugEnabled()){
			log.debug(e);
		}		
	}

	@Override
	public void debug(String e, Throwable t) {
		if(log.isDebugEnabled()){
			log.debug(e,t);
		}
		
	}

	@Override
	public void info(String e) {
		if(log.isInfoEnabled()){
			log.info(e);
		}
	}

	@Override
	public void info(String e, Throwable t) {
		if(log.isInfoEnabled()){
			log.info(e,t);
		}
		
	}

	@Override
	public void error(String e) {
	  if(log.isErrorEnabled()){
		  log.error(e);
	  }
		
	}
	@Override
	public void error(String e, Throwable t) {
		 if(log.isErrorEnabled()){
			  log.error(e,t);
		  }
	}
	@Override
	public void info(Object e) {
		if(log.isInfoEnabled()){
			log.info(e);
		}
	}

}
